<%= error_messages_for("task") %>

<p> <%= link_to("Back", :action => :list_tasks) %> </p>

<%= start_form_tag( :action => :save_task) %>
<table>
    <tr>
        <td> Title: </td>
        <td> <%= text_field("task", "title", "size" => 32) %>
    </tr>
    
    <tr>
        <td> Name: </td>
        <td> <%= text_field("task", "name", "size" => 32) %>
    </tr>
    
    <tr>  
        <td> Type: </td>
        <td> <%= text_field("task", "task_type", "size" => 3) %>
    </tr> 
       
    <tr>  
        <td> Difficulty: </td>
        <td> <%= text_field("task", "difficulty", "size" => 3) %>
    </tr>             
    
    <tr>
        <td></td>
        <td><%= submit_tag( "Save", {:class=>"submit"} ) %></td>
    </tr>
    
<table>

<%= hidden_field("task", "id" ) %>

<%= end_form_tag %>

<!-- Do this if only we have exicting task object in the database -->
<% if( @task.id ) -%>
    <table cellspacing="10">
        <tr>
            <td> <%= link_to('Tests', :action => :edit_task, :id => params[:id], :view => 1) %> </td>
            <td> <%= link_to('Modules', :action => :edit_task, :id => params[:id], :view => 2) %> </td>
            <td> <%= link_to('Checkers', :action => :edit_task, :id => params[:id], :view => 3) %> </td>
            <td> <%= link_to('Contents', :action => :edit_task, :id => params[:id], :view => 4) %> </td>
        </tr>
    <table>
    
    <hr>
    
    <%if( @view_component )%>  
            <%= render (:partial => @view_component ) %>
    <%end%>
        
  
<% end -%>

